@use "sass:color";

@mixin scrollBar($boolean: false, $trackBg: transparent, $thumbBg: #909399, $width: 6px) {
    @if $boolean {
        &::-webkit-scrollbar-track-piece {
            background-color: $trackBg;
        }

        &::-webkit-scrollbar {
            width: $width;
            height: $width;
        }

        &::-webkit-scrollbar-thumb {
            background-color: color.change($thumbBg, $alpha: 0.3);
            border-radius: 4px;

            &:hover {
                background-color: color.change($thumbBg, $alpha: 0.5);
            }
        }
    } @else {
        ::-webkit-scrollbar-track-piece {
            background-color: $trackBg;
        }

        ::-webkit-scrollbar {
            width: $width;
            height: $width;
        }

        ::-webkit-scrollbar-thumb {
            background-color: color.change($thumbBg, $alpha: 0.3);
            border-radius: 4px;

            &:hover {
                background-color: color.change($thumbBg, $alpha: 0.5);
            }
        }
    }
}
